def fall(strengur):
	svar = ""
	for x in range(10):
		if x < 9:
			svar += str(strengur.count(str(x))) + " "
		else:
			svar += str(strengur.count(str(x)))
	return svar

oft = int(input())

for y in range(oft):
	fjoldi = int(input())
	strengur = ""
	for x in range(fjoldi):
		strengur += str(x+1)
	print(fall(strengur))
